IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_TemplateDelete]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_TemplateDelete]
GO
create procedure [dbo].[cms_sp_TemplateDelete]
(
@Id int
)
as
delete from dbo.TemplateRegions
 where TemplateId = @Id

delete from dbo.Templates
 where TemplateId = @Id

GO

